package d1208.Ljs2.Ljs24;

import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class Demo1 {
    //将上题的内容读取到Map<Strin,String>map中，遍历map集合
    public static void main(String[] args) throws Exception{
        FileInputStream fileInputStream = new FileInputStream("E:\\代码\\代码练习和作业\\Zuoye12月6号\\src\\Ljs2\\Ljs24\\mapdata.properties");
        Properties properties = new Properties();
        properties.load(fileInputStream);
        fileInputStream.close();
        HashMap<Object, Object> map = new HashMap<>();
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            map.put(entry.getKey(),entry.getValue());
        }
        for (Map.Entry<Object, Object> entry : map.entrySet()) {
            System.out.println(entry.getKey()+" "+entry.getValue());
        }
    }
}
